//
//  EGORefreshHeaderView.h
//  IceBreaker
//
//  Created by Chiao Wolfire on 12-10-2.
//  Copyright (c) 2012年 NDS. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

typedef enum{
	EGOOPullRefreshPulling = 0,
	EGOOPullRefreshNormal,
	EGOOPullRefreshLoading,	
} EGOPullRefreshState;

@protocol EGORefreshHeaderDelegate;
@interface EGORefreshHeaderView : UIView {
    id _delegate;
    EGOPullRefreshState state;
    
    UILabel *lastUpdatedLabel;
    UILabel *statusLabel;
    CALayer *arrowImage;
    UIActivityIndicatorView *activityView;
}

@property(nonatomic, assign) id <EGORefreshHeaderDelegate> delegate;
-(void)refreshLastUpdatedDate;
-(void)egoRefreshScrollViewDidScroll: (UIScrollView *)scrollView;
-(void)egoRefreshScrollViewDidEndDragging: (UIScrollView *)scrollView;
-(void)egoRefreshScrollViewDataSourceDidFinishedLoading: (UIScrollView *)scrollView;

@end

@protocol EGORefreshHeaderDelegate
-(void)egoHeaderDidTriggerRefresh: (EGORefreshHeaderView *)view;
-(BOOL)egoHeaderDataSourceIsLoading: (EGORefreshHeaderView *)view;
@optional
-(NSDate*)egoHeaderDataSourceLastUpdated: (EGORefreshHeaderView *)view;
@end
